const gulp = require('gulp');
const babel = require('gulp-babel');
const gulpif = require('gulp-if');

const scriptsGlob = './**';
const excludeDir = ['!./node_modules/**', '!./node_modules', '!./build/**', '!./build', '!gulpfile.js'];
gulp.task('default', function () {
    return gulp.src([scriptsGlob, ...excludeDir])
        .pipe((gulpif('*.js', babel({
            presets: ['es2015']
        }))))
        .pipe(gulp.dest('build/'));
});

